
package std.time

import std.convert.*
import std.collection.ArrayList

@!APILevel[
    since: "22"
]
public struct DateTime <: ToString & Hashable & Comparable<DateTime> & Formattable & Parsable<DateTime> {
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws ArithmeticException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static prop UnixEpoch: DateTime
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws InvalidDataException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public prop year: Int64
    
    /**
    * @throws InvalidDataException
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public prop month: Month
    
    /**
    * @throws InvalidDataException
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @Deprecated[message: "Use `public prop month: Month` instead."]
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public prop monthValue: Int64
    
    /**
    * @throws InvalidDataException
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public prop dayOfMonth: Int64
    
    /**
    * @throws IndexOutOfBoundsException
    * @throws InvalidDataException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public prop dayOfWeek: DayOfWeek
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws InvalidDataException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public prop dayOfYear: Int64
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws InvalidDataException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public prop hour: Int64
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws InvalidDataException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public prop minute: Int64
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws InvalidDataException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public prop second: Int64
    
    @!APILevel[
        since: "22"
    ]
    public prop nanosecond: Int64
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws InvalidDataException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public prop isoWeek: (Int64, Int64)
    
    @!APILevel[
        since: "22"
    ]
    public prop zone: TimeZone
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws InvalidDataException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public prop zoneId: String
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws InvalidDataException
    * @throws ArithmeticException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public prop zoneOffset: Duration
    
    /**
    * @throws InvalidDataException
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public prop date: (Int64, Month, Int64)
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws InvalidDataException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public prop time: (Int64, Int64, Int64)
    
    @Frozen
    @!APILevel[
        since: "22"
    ]
    public static func now(timeZone!: TimeZone = TimeZone.Local): DateTime
    
    @!APILevel[
        since: "22"
    ]
    public static func nowUTC(): DateTime
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws InvalidDataException
    * @throws ArithmeticException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func fromUnixTimeStamp(d: Duration): DateTime
    
    /**
    * @throws ArithmeticException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func ofEpoch(second!: Int64, nanosecond!: Int64): DateTime
    
    /**
    * @throws ArithmeticException
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws InvalidDataException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func of(
        year!: Int64,
        month!: Int64,
        dayOfMonth!: Int64,
        hour!: Int64 = 0,
        minute!: Int64 = 0,
        second!: Int64 = 0,
        nanosecond!: Int64 = 0,
        timeZone!: TimeZone = TimeZone.Local
    ): DateTime
    
    /**
    * @throws ArithmeticException
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws InvalidDataException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func of(
        year!: Int64,
        month!: Month,
        dayOfMonth!: Int64,
        hour!: Int64 = 0,
        minute!: Int64 = 0,
        second!: Int64 = 0,
        nanosecond!: Int64 = 0,
        timeZone!: TimeZone = TimeZone.Local
    ): DateTime
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws ArithmeticException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func ofUTC(
        year!: Int64,
        month!: Int64,
        dayOfMonth!: Int64,
        hour!: Int64 = 0,
        minute!: Int64 = 0,
        second!: Int64 = 0,
        nanosecond!: Int64 = 0
    ): DateTime
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws ArithmeticException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func ofUTC(
        year!: Int64,
        month!: Month,
        dayOfMonth!: Int64,
        hour!: Int64 = 0,
        minute!: Int64 = 0,
        second!: Int64 = 0,
        nanosecond!: Int64 = 0
    ): DateTime
    
    /**
    * @throws ArithmeticException
    * @throws IllegalMemoryException
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws OutOfMemoryError
    * @throws InvalidDataException
    * @throws TimeParseException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func parse(str: String): DateTime
    
    /**
    * @throws ArithmeticException
    * @throws IllegalMemoryException
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws OutOfMemoryError
    * @throws InvalidDataException
    * @throws TimeParseException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func tryParse(str: String): Option<DateTime>
    
    /**
    * @throws ArithmeticException
    * @throws IllegalMemoryException
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws OutOfMemoryError
    * @throws InvalidDataException
    * @throws TimeParseException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func parse(str: String, format: String): DateTime
    
    /**
    * @throws ArithmeticException
    * @throws IllegalMemoryException
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws OutOfMemoryError
    * @throws InvalidDataException
    * @throws TimeParseException
    */
    @Deprecated[message: "Use member funtion `public static func parse(str: String, format: String): DateTime` instead."]
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func parse(str: String, format: DateTimeFormat): DateTime
    
    /**
    * @throws ArithmeticException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func inUTC(): DateTime
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws InvalidDataException
    * @throws ArithmeticException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func inLocal(): DateTime
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws InvalidDataException
    * @throws ArithmeticException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func inTimeZone(timeZone: TimeZone): DateTime
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws ArithmeticException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func toUnixTimeStamp(): Duration
    
    /**
    * @throws InvalidDataException
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func toString(): String
    
    /**
    * @throws InvalidDataException
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func format(fmt: String): String
    
    /**
    * @throws InvalidDataException
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @Deprecated[message: "Use member funtion `public func format(fmt: String): String` instead."]
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func toString(format: DateTimeFormat): String
    
    @!APILevel[
        since: "22"
    ]
    public func hashCode(): Int64
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws InvalidDataException
    * @throws ArithmeticException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func addYears(n: Int64): DateTime
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws InvalidDataException
    * @throws ArithmeticException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func addMonths(n: Int64): DateTime
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws InvalidDataException
    * @throws ArithmeticException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func addWeeks(n: Int64): DateTime
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws InvalidDataException
    * @throws ArithmeticException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func addDays(n: Int64): DateTime
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws InvalidDataException
    * @throws ArithmeticException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func addHours(n: Int64): DateTime
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws InvalidDataException
    * @throws ArithmeticException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func addMinutes(n: Int64): DateTime
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws InvalidDataException
    * @throws ArithmeticException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func addSeconds(n: Int64): DateTime
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws InvalidDataException
    * @throws ArithmeticException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func addNanoseconds(n: Int64): DateTime
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws InvalidDataException
    * @throws ArithmeticException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public operator func +(r: Duration): DateTime
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    * @throws InvalidDataException
    * @throws ArithmeticException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public operator func -(r: Duration): DateTime
    
    /**
    * @throws ArithmeticException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public operator func -(r: DateTime): Duration
    
    @!APILevel[
        since: "22"
    ]
    public operator func ==(r: DateTime): Bool
    
    @!APILevel[
        since: "22"
    ]
    public operator func !=(r: DateTime): Bool
    
    @!APILevel[
        since: "22"
    ]
    public operator func >=(r: DateTime): Bool
    
    @!APILevel[
        since: "22"
    ]
    public operator func >(r: DateTime): Bool
    
    @!APILevel[
        since: "22"
    ]
    public operator func <=(r: DateTime): Bool
    
    @!APILevel[
        since: "22"
    ]
    public operator func <(r: DateTime): Bool
    
    @!APILevel[
        since: "22"
    ]
    public func compare(rhs: DateTime): Ordering
}

@!APILevel[
    since: "22"
]
public class TimeParseException <: Exception {
    @!APILevel[
        since: "22"
    ]
    public init()
    
    @!APILevel[
        since: "22"
    ]
    public init(message: String)
}

@!APILevel[
    since: "22"
]
public class DateTimeFormat {
    @!APILevel[
        since: "22"
    ]
    public static const RFC1123: String = "www, dd MMM yyyy HH:mm:ss z"
    
    @!APILevel[
        since: "22"
    ]
    public static const RFC3339: String = "yyyy-MM-ddTHH:mm:ssOOOO"
    
    @!APILevel[
        since: "22"
    ]
    public static const RFC822: String = "ww dd MMM yy HH:mm:ss z"
    
    @!APILevel[
        since: "22"
    ]
    public static const RFC850: String = "wwww, dd-MMM-yy HH:mm:ss z"
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    */
    @Deprecated["Use member function `init(formatString: String)` instead."]
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func of(format: String): DateTimeFormat
    
    @Deprecated["The prop is deprecated, no substitutions."]
    @!APILevel[
        since: "22"
    ]
    public prop format: String
}

@!APILevel[
    since: "22"
]
public enum DayOfWeek <: ToString & Equatable<DayOfWeek> {
    @!APILevel[
        since: "22"
    ]
    Sunday |
    @!APILevel[
        since: "22"
    ]
    Monday |
    @!APILevel[
        since: "22"
    ]
    Tuesday |
    @!APILevel[
        since: "22"
    ]
    Wednesday |
    @!APILevel[
        since: "22"
    ]
    Thursday |
    @!APILevel[
        since: "22"
    ]
    Friday |
    @!APILevel[
        since: "22"
    ]
    Saturday
    /**
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func of(dayOfWeek: Int64): DayOfWeek
    
    @Deprecated[message: "Use member function `public func toInteger(): Int64` instead."]
    @!APILevel[
        since: "22"
    ]
    public func value(): Int64
    
    @!APILevel[
        since: "22"
    ]
    public func toInteger(): Int64
    
    /**
    * @throws IndexOutOfBoundsException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func toString(): String
    
    @!APILevel[
        since: "22"
    ]
    public operator func ==(r: DayOfWeek): Bool
    
    @!APILevel[
        since: "22"
    ]
    public operator func !=(r: DayOfWeek): Bool
    
    /**
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public operator func +(n: Int64): DayOfWeek
    
    /**
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public operator func -(n: Int64): DayOfWeek
}

@!APILevel[
    since: "22"
]
public enum Month <: ToString & Equatable<Month> {
    @!APILevel[
        since: "22"
    ]
    January |
    @!APILevel[
        since: "22"
    ]
    February |
    @!APILevel[
        since: "22"
    ]
    March |
    @!APILevel[
        since: "22"
    ]
    April |
    @!APILevel[
        since: "22"
    ]
    May |
    @!APILevel[
        since: "22"
    ]
    June |
    @!APILevel[
        since: "22"
    ]
    July |
    @!APILevel[
        since: "22"
    ]
    August |
    @!APILevel[
        since: "22"
    ]
    September |
    @!APILevel[
        since: "22"
    ]
    October |
    @!APILevel[
        since: "22"
    ]
    November |
    @!APILevel[
        since: "22"
    ]
    December
    /**
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func of(mon: Int64): Month
    
    @Deprecated[message: "Use member function `public func toInteger(): Int64` instead."]
    @!APILevel[
        since: "22"
    ]
    public func value(): Int64
    
    @!APILevel[
        since: "22"
    ]
    public func toInteger(): Int64
    
    /**
    * @throws IndexOutOfBoundsException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func toString(): String
    
    /**
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public operator func +(n: Int64): Month
    
    /**
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public operator func -(n: Int64): Month
    
    @!APILevel[
        since: "22"
    ]
    public operator func ==(r: Month): Bool
    
    @!APILevel[
        since: "22"
    ]
    public operator func !=(r: Month): Bool
}

@!APILevel[
    since: "22"
]
public struct MonoTime <: Hashable & Comparable<MonoTime> {
    @!APILevel[
        since: "22"
    ]
    public static func now(): MonoTime
    
    /**
    * @throws ArithmeticException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public operator func +(r: Duration): MonoTime
    
    /**
    * @throws ArithmeticException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public operator func -(r: Duration): MonoTime
    
    /**
    * @throws ArithmeticException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public operator func -(r: MonoTime): Duration
    
    @!APILevel[
        since: "22"
    ]
    public operator func ==(r: MonoTime): Bool
    
    @!APILevel[
        since: "22"
    ]
    public operator func !=(r: MonoTime): Bool
    
    @!APILevel[
        since: "22"
    ]
    public operator func >=(r: MonoTime): Bool
    
    @!APILevel[
        since: "22"
    ]
    public operator func >(r: MonoTime): Bool
    
    @!APILevel[
        since: "22"
    ]
    public operator func <=(r: MonoTime): Bool
    
    @!APILevel[
        since: "22"
    ]
    public operator func <(r: MonoTime): Bool
    
    @!APILevel[
        since: "22"
    ]
    public func compare(rhs: MonoTime): Ordering
    
    @!APILevel[
        since: "22"
    ]
    public func hashCode(): Int64
}

@!APILevel[
    since: "22"
]
public class TimeZone <: ToString & Equatable<TimeZone> {
    @!APILevel[
        since: "22"
    ]
    public static let UTC: TimeZone = TimeZone("UTC", 0)
    
    @!APILevel[
        since: "22"
    ]
    public static let Local: TimeZone = initLocal()
    
    @!APILevel[
        since: "22"
    ]
    public prop id: String
    
    /**
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public init(id: String, offset: Duration)
    
    /**
    * @throws IllegalMemoryException
    * @throws IndexOutOfBoundsException
    * @throws InvalidDataException
    * @throws OutOfMemoryError
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func load(id: String): TimeZone
    
    /**
    * @throws IndexOutOfBoundsException
    * @throws InvalidDataException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func loadFromPaths(id: String, tzpaths: Array<String>): TimeZone
    
    /**
    * @throws IndexOutOfBoundsException
    * @throws InvalidDataException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func loadFromTZData(id: String, data: Array<UInt8>): TimeZone
    
    @!APILevel[
        since: "22"
    ]
    public func toString(): String
    
    @!APILevel[
        since: "22"
    ]
    public operator func ==(r: TimeZone): Bool
    
    @!APILevel[
        since: "22"
    ]
    public operator func !=(r: TimeZone): Bool
}

@!APILevel[
    since: "22"
]
public class InvalidDataException <: Exception {
    @!APILevel[
        since: "22"
    ]
    public init()
    
    @!APILevel[
        since: "22"
    ]
    public init(message: String)
}

